package cat.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class TestController {
    @RequestMapping("/test")
    public String  test(ModelMap m) {
        System.out.println("这里进行程序处理..查询数据....");
        m.put("msg","我的springMvc流程走通了");
        return "/index.jsp";   //==>  /jsp/index.jsp
    }

    @RequestMapping("/login")
    public String login(Model model,String username,String password){
        if("YuXinTong".equals(username)&&"123456".equals(password)){
        model.addAttribute("msg","登录");
        return "login";
        }
        return "main";
    }
}
